home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 April / Chip CMCD0400.iso / SOFTWARE / Freeware / Programare / BinHeader / ReadMe.txt < prev   
Encoding:
Text File  |  2000-01-22  |  2.5 KB  |  80 lines

  1. --
  2. Binary -> C/C++ Header Converter v1.0 - Readme
  3. --
  4.  
  5.   Disclaimer: CheeserWare Cannot Be Held Responsible For Any Damages
  6. Or Side Effects This Program May Cause, Mentally Or Physically.
  7.  
  8. --
  9.  
  10.   Bin->Header Is A Developer Tool For Converting Binary Files Into
  11. C/C++ Headers, This Is Useful For Linking External Files Into The
  12. Executable.
  13.  
  14. --
  15.  
  16.   Installation: An Installation Wizard Was Not Used In This Project, Because
  17. It's Just Too Small And Simple To Need An Installer. The Installer Logo BMP
  18. Alone Would Be Bigger Than The Entire Application :)
  19.  
  20.   To Install: Unzip BinHeader10.zip To A Directory Of Your Choice. It Can
  21. Be Run From Any Directory. It Doesn't Create Any Files Other Than The
  22. Destination File You Specify.
  23.  
  24. --
  25.  
  26.   Example:
  27.   Replace "IDENTIFIER" With Whatever Identifier You Specified In Conversion
  28.   "IDENTIFIER_size" Is The Length, In Bytes Of "IDENTIFIER"
  29.  
  30.  
  31.   //Include The File As Any Other Include File
  32.   #include "thehdrfile.h"
  33.  
  34.   
  35.   signed long i;
  36.   for(i=0;i<IDENTIFIER_size;i++)
  37.   {
  38.       unsigned char eachbyte=IDENTIFIER[i];
  39.       /* 
  40.          This Will Loop Through Each Byte Of The Data, Setting "eachbyte" 
  41.          To The Byte Value At Offset "i". Your Handler Code Goes Here.
  42.          For Example, To Display A Block Of Standard Text:
  43.          cprintf("%c",eachbyte);
  44.       */
  45.   };
  46.  
  47.  
  48.   //For Block Copying
  49.  
  50.   #define bytestocopy 1024
  51.   unsigned char destblock[bytestocopy];
  52.   memcpy(destblock,&IDENTIFIER[sourceoffset],bytestocopy);
  53.   //This Will Copy "bytestocopy" Bytes From "sourceoffset", Into "destblock"
  54.  
  55.  
  56.   //To Write The Data To A File
  57.   int h=createfileandreturnhandle();
  58.   write(h,IDENTIFIER,IDENTIFIER_size);
  59.   close(h);
  60.  
  61. --
  62.  
  63.   Note: To Use Data Linked Into Your Executable Efficiently, Write Your
  64. Load Functions To Be Capable Of Loading Straight Out Of Memory As Well As 
  65. Files. Once You've Worked With It A Couple Times You'll Find You Can Load
  66. Any Format Straight Out Of Memory. I Have Made Non-Public Libraries Capable
  67. Of Loading PCX, BMP, WAV, MID, Others. This Code Is Currently Not Publicly
  68. Available, But Perhaps It's Existance Will Inspire You To Try It Yourself.
  69.   If You Are A Beginner, You Can Just Write The Data To A Temporary File
  70. At Runtime, Then Give The Temporary File To Your LoadFile() Code. This Is
  71. Slow And Inefficient, But Functional.
  72.  
  73. --
  74.  
  75. -Cheeser [SLC, UT]
  76. E-mail - cheeser@aros.net    :  Questions, Comments, Bug Reports
  77. Web - www.aros.net/~cheeser  :  CheeserWare Home Page
  78.  
  79. --
  80.